home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-13 | 6.5 KB | 152 lines | [TEXT/UNIX] |
- .ad l
- .nh
- .TH MIFF 5 "1 January 1991" "X Version 11"
- .SH "MIFF FILE FORMAT"
- .PP
- The Machine Independent File Format is described in this section.
- .PP
- A MIFF image file consist of two sections. The first section is
- composed of keywords describing the image in text form. The next
- section is the binary image data. The two sections are separated by a
- \fB:\fP character immediately followed by a \fInewline\fP. Generally,
- the first section has a \fIform-feed\fP and \fInewline\fP proceeding
- the \fB:\fP character. You can then list the image keywords with
- \fImore\fP, without printing the binary image that follows the \fB:\fP
- separator.
- .PP
- Each keyword must be separated by at least one space but can be
- separated with control characters such a \fIform-feed\fP or
- \fInewline\fP.
- .PP
- A list of valid keywords follows:
- .TP 5
- .B "class=\fIDirectClass | PseudoClass\fP"
- identifies the type of binary image stored within the file.
-
- This keyword is optional. If it is not specified, a \fIDirectClass\fP
- image format is assumed. An explanation of \fIDirectClass\fP and
- \fIPseudoClass\fP image data follows this list.
- .TP 5
- .B "colors=\fIvalue\fP"
- specifies the number of colors in the image, and for pseudo-color
- images the size of the colormap.
-
- This keyword is optional. However, if a colormap size is not
- specified, a linear colormap is assumed for pseudo-color images.
- .TP 5
- .B "columns=\fIvalue\fP"
- is a required keyword and specifies the number of columns, or width in
- pixels, of the image.
- .TP 5
- .B "compression=\fIQEncoded | RunlengthEncoded\fP"
- identifies how the image stored within the file is compressed.
-
- This keyword is optional. If it is not specified, the image is assumed
- to be uncompressed. A detailed explanation of runlength-encoded and
- Q-coder image compression follows this list.
- .TP 5
- .B "id=\fIImageMagick\fP"
- is a required keyword and identifies this file as a MIFF image.
- .TP 5
- .B "packets=\fIvalue\fP"
- specifies the number of compressed color packets in the image data section.
-
- This keyword is optional, but recommended, for runlength-encoded image
- compression. It is required for Q-encoded image compression. A
- detailed explanation of image compression follows this list.
- .TP 5
- .B "rows=\fIvalue\fP"
- is a required keyword and specifies the number of rows, or height in pixels,
- of the image.
- .TP 5
- .B "scene=\fIvalue\fP"
- is an optional keyword and is a reference number for sequencing of
- images.
-
- This keyword is typically useful for animating a sequence of images.
- .PP
- Comments can be included in the keyword section. Comments must begin with
- a \fB{\fP character and end with a \fI}\fP character.
- .PP
- An example keyword section follows:
- .PP
- {
- Rendered via Dore by Sandy Hause.
- }
- id=ImageMagick
- class=PseudoClass colors=256
- compression=RunlengthEncoded packets=27601
- columns=1280 rows=1024
- scene=1
- ^L
- :
- .PP
- The binary image data that follows the keyword text is stored in one of
- two binary classes as specified by the \fBclass\fP keyword:
- \fIDirectClass\fP or \fIPseudoClass\fP.
- .PP
- Use the \fIDirectClass\fP class to store continuous-tone images.
- \fIDirectClass\fP requires that the image pixels immediately follow the
- keyword text and be stored as binary red, green, and blue intensity
- values. The total number of pixels expected is equal to the number of pixel
- columns times the number of pixel rows as specified by the \fBcolumns\fP and
- \fBrows\fP keywords.
- .PP
- If the \fBcompression\fP keyword is not specified, a red, green, and blue byte
- in that order is expected for each pixel of the image.
- .PP
- If \fBcompression\fP is \fIQEncoded\fP, each red, green, and blue byte
- intensity value is encoded using the Q-coder compression algorithm.
- Use the \fBpackets\fP keyword to specify the total number of Q-encoded
- packets that comprise the image. Refer to "Sofware implementations of
- the Q-Coder", by Mitchell, J. L. and Pennebaker, W.B. (IBM Journal Res.
- Development, Volume 32, Number 6, November 1988, pages 753 - 774) for
- implementation specific details.
- .PP
- If \fBcompression\fP is \fIRunlengthEncoded\fP, each red, green, and
- blue byte intensity value is followed by a count byte. This value
- specifies the number of horizonally contiguous pixels in the image of
- that color. The count (0-255) is one less than the actual number of
- contiguous pixels; thus a single packet can represent from 1 up to 256
- identical pixels. The total number of pixels specified by the
- individual count bytes must add up to the number of pixel columns times
- the number of pixel rows as specified by the \fBcolumns\fP and
- \fBrows\fP keywords. Use \fBpackets\fP to specify the total number of
- runlength-encoded packets that comprise the image.
- .PP
- Use the \fIPseudoClass\fP class to store pseudo-color images.
- \fIPseudoClass\fP requires that the image colormap and
- pseudo-color pixels immediately follow the keyword text. The colormap
- is stored as contiguous red, green, and blue intensity values. The
- number of intensity values expected is determined by the \fBcolors\fP
- keyword. Note, an image colormap is restricted to at most 65535
- entries. The binary pseudo-color image is stored as indexes into the
- colormap. If the colormap size exceeds 256 entries, then each colormap
- index is two bytes each with the most-significant-byte first. The
- total number of pixels expected is equal to the number of pixel columns
- times the number of pixel rows as specified by the \fBcolumns\fP and
- \fBrows\fP keywords.
- .PP
- If the \fBcompression\fP keyword is not specified, a colormap index is
- expected for each pixel of the image.
- .PP
- If \fBcompression\fP is \fIQEncoded\fP, each colormap index is
- encoded using the Q-coder compression algorithm. Use the \fBpackets\fP
- keyword to specify the total number of Q-encoded packets comprise the
- image. Refer to "Sofware implementations of the Q-Coder", by Mitchell,
- J. L. and Pennebaker, W.B. (IBM Journal Res. Development, Volume 32,
- Number 6, November 1988, pages 753 - 774) for implementation specific
- details.
- .PP
- If \fBcompression\fP is \fIRunlengthEncoded\fP, each colormap index
- is followed by a count byte. This value specifies the number of
- horizonally contiguous pixels in the image of that color. The count
- (0-255) is one less than the actual number of contiguous pixels; thus a
- single packet can represent from 1 up to 256 identical pixels. The
- total number of pixels specified by the individual count bytes must add
- up to the number of pixels expected in the image as specified by the
- \fBcolumns\fP and \fBrows\fP keywords. Use \fBpackets\fP to specify the
- total number of runlength-encoded packets that comprise the image.
-
-
-